<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>添加话题</title>
</head>
<body>
<form>
	<table border="1" width="250px" bordercolor="#AAAAAA" bgcolor="#AAAAAA"  >
	<caption><font color="#AAAAAA" face="黑体" size="+2">添加话题</font></caption>
	<tr >
		<td width="20px" align="center">主题</td><td width="80px" align="left"><input type="text" id="topicname" name="topicname" placeholder="请编辑主题" /></td>
	</tr>
	<tr>
		<td width="20px"  align="center">发帖号</td><td width="80px" align="left"><input type="text" id="id"  value=""/></td>
	</tr>
	<tr >
		<td width="20%" height="200px" align="center">内容</td><td width="80%"><textarea style="height:200px" id="topicdtails" placeholder="请编辑详细内容" value=""/></textarea></td>
	</tr>
	<tr>
		<td width="50%" align="center"><input type ="button" onclick="settopic();" value="确定"/></td><td width="50%" align="center"><input type="reset" value="重置"/></td>
	</tr>								
	</table>
</form>
</body>
<script src="./js/jquery-3.2.1.min.js"></script>
<script type="text/javascript">

	function settopic(){
		var topicname = document.getElementById("topicname").value;
		var id = document.getElementById("id").value;
		var topicdtails = document.getElementById("topicdtails").value;
		$.ajax({
			type:"POST",
			url:"addtopic.action",
			data:{topicname:topicname,id:id,topicdtails:topicdtails},
			contentType:"aplication/json",
			dataType:"json",
			success:function(data){
				alert("添加成功");
			}
		});
	}
</script>

</html>